import { request } from '@/framework/utils/request-jdz';
import _ from 'lodash-es';
// 获取出库盒子和冻存管信息
export const getOutputData = (queryParam, queryOpt) => {
  let searchData = _.pickBy({ ...queryParam, ...queryOpt });
  return request(
    {
      url: '/stock/outable',
      method: 'get',
      params: searchData,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
export const outputSearch = (searchData) => {
  return request(
    {
      url: '/bill-out',
      method: 'get',
      params: searchData,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 获取出库单详情
export const billOut = (id) => {
  return request(
    {
      url: '/bill-out/' + id + '/detail',
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 获取出库单单号
export const generateBatchNo = () => {
  return request(
    {
      url: '/bill-out/generate/batch-no',
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 创建出库单
export const postOutPut = (data) => {
  return request(
    {
      url: '/bill-out',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
//取出样本
export const patchOutPut = (data) => {
  return request(
    {
      url: '/bill-out',
      method: 'PATCH',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
//根据试管id请求数据(出库使用)
export const getIssueData = (params) => {
  return request(
    {
      url: `/stock/assemble-strain?strainIds=${params}`,
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 通知三方系统取出指定库存
export const billOutTakeout = (id) => {
  return request(
    {
      url: '/bill-out/' + id + '/takeout',
      method: 'post',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 基点忽略
export const billOutIgnore = (id, data) => {
  return request(
    {
      url: '/bill-out/' + id + '/ignore',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 入库单删除
export const DELETEinputUp = (id) => {
  return request(
    {
      url: `/bill-out/${id}`,
      method: 'DELETE',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
